
<div class="form-group">
    <label class="col-lg control-label must">身份名称</label>
    <div class="col-sm-8">
        <select name="identity_id" class="select2" style="width:150px;">
            <option value="">请选择身份</option>
            {loop $identity $row}
            <option value="{$row['id']}" {if $item['identity_id'] == $row['id']}selected{/if}>{$row['name']}{if $row['status'] == 0}(未审核){/if}</option>
            {/loop}
        </select>
    </div>
</div>


{if !empty($member)}
<div class="form-group">
    <label class="col-lg control-label">昵称</label>
    <div class="col-sm-8">
        <div class="form-control-static"><a target="_blank" href="{php echo webUrl('member/list/detail',array('id'=>$member['id']))}"> {$member['nickname']}</a></div>
    </div>
</div>

<div class="form-group">
    <label class="col-lg control-label">openid</label>
    <div class="col-sm-8">
        <div class="form-control-static">{$member['openid']}</div>
    </div>
</div>
{/if}

<div class="form-group-title">身份信息</div>
<!-- 会员 start -->
<div class="form-group">
    <label class="col-lg control-label">是否使用会员等级</label>
    <div class="col-sm-8">
        <label class="radio-inline">
            <input type="radio" name='is_use_member_level' value="1" {if $identity['is_use_member_level']==1}checked{/if} onclick="levelshow('member')"/> 是
        </label>
        <label class="radio-inline">
            <input type="radio" name='is_use_member_level' value="0" {if empty($identity['is_use_member_level'])}checked{/if} onclick="levelhide('member')"/> 否
        </label>
    </div>
</div>
<div class="form-group" id="member" {if empty($identity['is_use_member_level'])}style="display:none;"{/if}>
    <label class="col-lg control-label">当前会员等级</label>
    <div class="col-sm-2">
        {if empty($member['level'])}
        默认等级
        {else}
        {loop $user $row}
            {if $member['level'] == $row['id']}{$row['levelname']}{if $row['enabled'] == 0}(未启用){/if}{/if}
        {/loop}
        {/if}
    </div>
    <label class="col-lg control-label">身份有效期会员等级</label>
    <div class="col-sm-2">
        <select name="shop_user_grade_id" class="select2" style="width:150px;">
            <option value="">请选择会员等级</option>
            <option value="" {if $identity['shop_user_grade_id'] == '0'}selected{/if}>默认等级</option>
            {loop $user $row}
            <option value="{$row['id']}" {if $identity['shop_user_grade_id'] == $row['id']}selected{/if}>{$row['levelname']}{if $row['enabled'] == 0}(未启用){/if}</option>
            {/loop}
        </select>
    </div>

    <label class="col-lg control-label">到期会员等级</label>
    <div class="col-sm-2">
        <select name="end_shop_user_grade_id" class="select2" style="width:150px;">
            <option value="">请选择会员等级</option>
            <option value="" {if $identity['end_shop_user_grade_id'] == '0'}selected{/if}>默认等级</option>
            {loop $user $row}
            <option value="{$row['id']}" {if $identity['end_shop_user_grade_id'] == $row['id']}selected{/if}>{$row['levelname']}{if $row['enabled'] == 0}(未启用){/if}</option>
            {/loop}
        </select>
    </div>
</div>
<!-- 会员 end -->


<!-- 分销 start -->
<div class="form-group">
    <label class="col-lg control-label">是否使用分销等级</label>
    <div class="col-sm-8">
        <label class="radio-inline">
            <input type="radio" name='is_use_distribution_level' value="1" {if $identity['is_use_distribution_level']==1}checked{/if} onclick="levelshow('distribution')"/> 是
        </label>
        <label class="radio-inline">
            <input type="radio" name='is_use_distribution_level' value="0" {if empty($identity['is_use_distribution_level'])}checked{/if} onclick="levelhide('distribution')"/> 否
        </label>
    </div>
</div>
<div class="form-group" id="distribution" {if empty($identity['is_use_distribution_level'])}style="display:none;"{/if}>
    <label class="col-lg control-label">当前分销商等级</label>
    <div class="col-sm-2">
        {loop $distribution $row}
            {if $member['agentlevel'] == $row['id']}{$row['levelname']}{if $member['status']}(未审核){/if}{/if}
        {/loop}
    </div>
    <label class="col-lg control-label">身份有效期分销商等级</label>
    <div class="col-sm-2">
        <select name="distribution_grade_id" class="select2" style="width:150px;">
            <option value="">请选择分销商等级</option>
            <option value="" {if $identity['distribution_grade_id'] == '0'}selected{/if}>默认等级</option>
            {loop $distribution $row}
            <option value="{$row['id']}" {if $identity['distribution_grade_id'] == $row['id']}selected{/if}>{$row['levelname']}</option>
            {/loop}
        </select>
    </div>

    <label class="col-lg control-label">到期分销商等级</label>
    <div class="col-sm-2">
        <select name="end_distribution_grade_id" class="select2" style="width:150px;">
            <option value="">请选择分销商等级</option>
            <option value="-1" {if $identity['end_distribution_grade_id']=='-1'}selected{/if}>待审核</option>
            <option value="" {if $identity['end_distribution_grade_id'] == '0'}selected{/if}>默认等级</option>
            {loop $distribution $row}
            <option value="{$row['id']}" {if $identity['end_distribution_grade_id'] == $row['id']}selected{/if}>{$row['levelname']}</option>
            {/loop}
        </select>
    </div>
</div>
<!-- 分销 end -->


<!-- 门店 start -->
<div class="form-group">
    <label class="col-lg control-label">是否使用门店等级</label>
    <div class="col-sm-8">
        <label class="radio-inline">
            <input type="radio" name='is_use_mendian' value="1" {if $identity['is_use_mendian']=='1'}checked{/if}  onclick="levelshow('mendian')"/> 是 
        </label>
        <label class="radio-inline">
            <input type="radio" name='is_use_mendian' value="0" {if empty($identity['is_use_mendian'])}checked{/if} onclick="levelhide('mendian')"/> 否
        </label>
    </div>
</div>
<div class="form-group" id="mendian" {if empty($identity['is_use_mendian'])}style="display:none;"{/if}>
    <label class="col-lg control-label">当前门店等级</label>
    <div class="col-sm-2">
        {loop $mendian_level $row}
            {if $mendian_info['mendian_level'] == $row['id']}{$row['levelname']}{if $mendian_info['status'] == 0}(未审核){/if}{/if}
        {/loop}
    </div>
    <label class="col-lg control-label">身份有效期门店等级</label>
    <div class="col-sm-2">
        <select name="mendian_level_id" class="select2" style="width:150px;">
            <option value="">请选择门店等级</option>
            {loop $mendian_level $row}
            <option value="{$row['id']}" {if $identity['mendian_level_id'] == $row['id']}selected{/if}>{$row['levelname']}{if $row['status'] == 0}(未启用){/if}</option>
            {/loop}
        </select>
    </div>

    <label class="col-lg control-label">到期门店等级</label>
    <div class="col-sm-2">
        <select name="end_mendian_level_id" class="select2" style="width:150px;">
            <option value="">请选择门店等级</option>
            <option value="-1" {if $identity['end_mendian_level_id']=='-1'}selected{/if}>待审核</option>
            {loop $mendian_level $row}
            <option value="{$row['id']}" {if $identity['end_mendian_level_id'] == $row['id']}selected{/if}>{$row['levelname']}{if $row['status'] == 0}(未启用){/if}</option>
            {/loop}
        </select>
    </div>
</div>
<!-- 门店 end -->


<!-- 多商户 start -->
<div class="form-group">
    <label class="col-lg control-label">是否使用多商户</label>
    <div class="col-sm-8">
        <label class="radio-inline">
            <input type="radio" name='is_use_merch' value="1" {if $identity['is_use_merch']==1}checked{/if} onclick="levelshow('merch')"/> 是
        </label>
        <label class="radio-inline">
            <input type="radio" name='is_use_merch' value="0" {if empty($identity['is_use_merch'])}checked{/if} onclick="levelhide('merch')"/> 否
        </label>
    </div>
</div>
<div class="form-group" id="merch" {if empty($identity['is_use_merch'])}style="display:none;"{/if}>
    <label class="col-lg control-label">当前多商户等级</label>
    <div class="col-sm-2">
        {loop $merch_level $row}
            {if $merch_user['groupid'] == $row['id']}{$row['groupname']}{if $merch_user['status'] == '0'}(未审核){/if}{/if}
        {/loop}
    </div>
    <label class="col-lg control-label">身份有效期多商户等级</label>
    <div class="col-sm-2">
        <select name="merch_id" class="select2" style="width:150px;">
            <option value="">请选择多商户等级</option>
            {loop $merch_level $row}
            <option value="{$row['id']}" {if $identity['merch_id'] == $row['id']}selected{/if}>{$row['groupname']}</option>
            {/loop}
        </select>
    </div>

    <label class="col-lg control-label">到期多商户等级</label>
    <div class="col-sm-2">
        <select name="end_merch_id" class="select2" style="width:150px;">
            <option value="">请选择多商户等级</option>
            <option value="-1" {if $identity['end_merch_id']=='-1'}selected{/if}>待审核</option>
            {loop $merch_level $row}
            <option value="{$row['id']}" {if $identity['end_merch_id'] == $row['id']}selected{/if}>{$row['groupname']}</option>
            {/loop}
        </select>
    </div>
</div>
<!-- 多商户 end -->


<!-- 区域代理 start -->
<div class="form-group">
    <label class="col-lg control-label">是否使用区域代理</label>
    <div class="col-sm-8">
        <label class="radio-inline">
            <input type="radio" name='is_use_abonus_agent' value="1" {if $identity['is_use_abonus_agent']==1}checked{/if} onclick="levelshow('abonus')"/> 是
        </label>
        <label class="radio-inline">
            <input type="radio" name='is_use_abonus_agent' value="0" {if empty($identity['is_use_abonus_agent'])}checked{/if} onclick="levelhide('abonus')"/> 否
        </label>
    </div>
</div>
<div class="form-group" id="abonus" {if empty($identity['is_use_abonus_agent'])}style="display:none;"{/if}>
    <label class="col-lg control-label">当前区域代理等级</label>
    <div class="col-sm-2">
        {loop $abonus_level $row}
            {if $member['aagentlevel'] == $row['id']}{$row['levelname']}{if $member['aagentstatus'] == '0'}(未审核){/if}{/if}
        {/loop}
    </div>
    <label class="col-lg control-label">身份有效期区域代理等级</label>
    <div class="col-sm-2">
        <select name="abonus_agent_id" class="select2" style="width:150px;">
            <option value="">请选择区域代理等级</option>
            <option value="" {if $identity['abonus_agent_id']=='0'}selected{/if}>默认等级</option>
            {loop $abonus_level $row}
            <option value="{$row['id']}" {if $identity['abonus_agent_id'] == $row['id']}selected{/if}>{$row['levelname']}</option>
            {/loop}
        </select>
    </div>

    <label class="col-lg control-label">到期区域代理等级</label>
    <div class="col-sm-2">
        <select name="end_abonus_agent_id" class="select2" style="width:150px;">
            <option value="">请选择区域代理等级</option>
            <option value="-1" {if $identity['end_abonus_agent_id']=='-1'}selected{/if}>待审核</option>
            <option value="" {if $identity['end_abonus_agent_id']=='0'}selected{/if}>默认等级</option>
            {loop $abonus_level $row}
            <option value="{$row['id']}" {if $identity['end_abonus_agent_id'] == $row['id']}selected{/if}>{$row['levelname']}</option>
            {/loop}
        </select>
    </div>
</div>
<!-- 区域代理 end -->


<!-- 全民股东 start -->
<div class="form-group">
    <label class="col-lg control-label">是否使用全民股东</label>
    <div class="col-sm-8">
        <label class="radio-inline">
            <input type="radio" name='is_use_globonus_partner' value="1" {if $identity['is_use_globonus_partner']==1}checked{/if} onclick="levelshow('globonus')"/> 是
        </label>
        <label class="radio-inline">
            <input type="radio" name='is_use_globonus_partner' value="0" {if empty($identity['is_use_globonus_partner'])}checked{/if} onclick="levelhide('globonus')"/> 否
        </label>
    </div>
</div>
<div class="form-group" id="globonus" {if empty($identity['is_use_globonus_partner'])}style="display:none;"{/if}>
    <label class="col-lg control-label">当前全民股东等级</label>
    <div class="col-sm-2">
        {loop $globonus_level $row}
            {if $member['partnerlevel'] == $row['id']}{$row['levelname']}{if $member['partnerstatus'] == '0'}(未审核){/if}{/if}
        {/loop}
    </div>
    <label class="col-lg control-label">身份有效期全民股东等级</label>
    <div class="col-sm-2">
        <select name="globonus_partner_id" class="select2" style="width:150px;">
            <option value="">请选择全民股东等级</option>
            <option value="" {if $identity['globonus_partner_id']=='0'}selected{/if}>默认等级</option>
            {loop $globonus_level $row}
            <option value="{$row['id']}" {if $identity['globonus_partner_id'] == $row['id']}selected{/if}>{$row['levelname']}</option>
            {/loop}
        </select>
    </div>
    <label class="col-lg control-label">到期全民股东等级</label>
    <div class="col-sm-2">
        <select name="end_globonus_partner_id" class="select2" style="width:150px;">
            <option value="">请选择全民股东等级</option>
            <option value="-1" {if $identity['end_globonus_partner_id']=='-1'}selected{/if}>待审核</option>
            <option value="" {if $identity['end_globonus_partner_id']=='0'}selected{/if}>默认等级</option>
            {loop $globonus_level $row}
            <option value="{$row['id']}" {if $identity['end_globonus_partner_id'] == $row['id']}selected{/if}>{$row['levelname']}</option>
            {/loop}
        </select>
    </div>
</div>
<!-- 全民股东 end -->



<script type="text/javascript">
    function levelshow(obj){
        console.log('show'+obj);
        $("#"+obj).attr('style', 'display:block;');
    }
     function levelhide(obj){
        console.log('hide'+obj);
        $("#"+obj).attr('style', 'display:none;');
    }
</script>

<div class="form-group">
    <label class="col-lg control-label must">购买升级身份商品</label>
    <div class="col-sm-8">
        <input type="text" value="{$item['buy_goods_title']} ￥{$item['buy_goods_price']}" disabled class="form-control"/>
    </div>
</div>

<div class="form-group">
    <label class="col-lg control-label">开始时间</label>
    <div class="col-sm-8">
        {ife 'mendian.user' $item}
        {php echo tpl_form_field_date('start_time',$item['start_time'])}
        {else}
        <div class="form-control-static">{php echo date('Y-m-d',$item['start_time'])} 开始</div>
        {/if}
    </div>
</div>
<div class="form-group">
    <label class="col-lg control-label">到期时间</label>
    <div class="col-sm-8">
        {ife 'mendian.user' $item}
        {php echo tpl_form_field_date('end_time',$item['end_time'])}
        <span class="help-block">身份有效期限</span>
        {else}
        <div class="form-control-static">{php echo date('Y-m-d',$item['end_time'])} 到期</div>
        {/if}
    </div>
</div>

<div class="form-group-title">身份状态</div>
<div class="form-group">
    <label class="col-lg control-label">状态</label>
    <div class="col-sm-9 col-xs-12">
        <label class="radio-inline">
            <input type="radio" name='status' value="0" {if empty($item['status'])}checked{/if} /> 待启用
        </label>
        <label class="radio-inline">
            <input type="radio" name='status' value="1" {if $item['status']==1}checked{/if} /> 启用
        </label>
        <label class="radio-inline">
            <input type="radio" name='status' value="3" {if $item['status']==3}checked{/if} /> 停用
        </label>
        <!-- <label class="radio-inline">
            <input type="radio" name='status' value="2" {if $item['status']==2}checked{/if} /> 已过期
        </label> -->
        
    </div>
</div>

<!--青岛易联互动网络科技有限公司-->